package com.resys.mappers;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDateTime;

/**
 *  数据库操作接口
 */
@Mapper
public interface RoomstatuslogMapper<T,P> extends BaseMapper<T,P> {

	/**
	 * 根据LogId更新
	 */
	 Integer updateByLogId(@Param("bean") T t,@Param("logId") Integer logId);


	/**
	 * 根据LogId删除
	 */
	 Integer deleteByLogId(@Param("logId") Integer logId);


	/**
	 * 根据LogId获取对象
	 */
	 T selectByLogId(@Param("logId") Integer logId);

	@Select("select count(*) from roomstatuslog where changed_by = #{userId} and (changed_time between #{start} and #{end})")
    Integer getCountLog(String userId, LocalDateTime start, LocalDateTime end);
}
